package com.heima.admin.controller;

import com.heima.admin.dto.LoginDto;
import com.heima.admin.service.IAdUserService;
import com.heima.common.dto.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/login")
@Api(tags = "管理员登录")
public class LoginController {
    @Autowired
    private IAdUserService adUserService;
    @PostMapping("/in")
    @ApiOperation(value = "login", notes = "管理员登录")  // value =>指定名称   notes =>添加备注
    @ApiImplicitParam(name = "dto", value = "LoginDto", required = true) //required =>参数是否必填
    public ResponseResult login(@RequestBody LoginDto dto){

        return adUserService.login(dto);
    }
}
